package com.fh.modules.dbms.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author qiujunda
 * @Date 15/07/2020
 * @Description 对比结果模型
 */
public class CompareResultModel {

    public CompareResultModel(){

    }

    public CompareResultModel(Object sourceResult,Object destinationResult){
        this.sourceResult=sourceResult;
        this.destinationResult=destinationResult;
        this.result=(sourceResult==null||destinationResult==null||!sourceResult.equals(destinationResult))?0:1;
    }

    private BigDecimal rownum;
    //对比源结果
    private Object sourceResult;
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date created1;
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date lastDdlTime1;

    //对比目录结果
    private Object destinationResult;
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date created2;
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date lastDdlTime2;

    //对比结果0:不相同 1:相同
    private Integer result;

    public BigDecimal getRownum() {
        return rownum;
    }

    public void setRownum(BigDecimal rownum) {
        this.rownum = rownum;
    }

    public Object getSourceResult() {
        return sourceResult;
    }

    public void setSourceResult(Object sourceResult) {
        this.sourceResult = sourceResult;
    }

    public Object getDestinationResult() {
        return destinationResult;
    }

    public void setDestinationResult(Object destinationResult) {
        this.destinationResult = destinationResult;
    }

    public Integer getResult() {
        return result;
    }

    public void setResult(Integer result) {
        this.result = result;
    }
    public Date getCreated1() {
        return created1;
    }

    public void setCreated1(Date created1) {
        this.created1 = created1;
    }

    public Date getLastDdlTime1() {
        return lastDdlTime1;
    }

    public void setLastDdlTime1(Date lastDdlTime1) {
        this.lastDdlTime1 = lastDdlTime1;
    }

    public Date getCreated2() {
        return created2;
    }

    public void setCreated2(Date created2) {
        this.created2 = created2;
    }

    public Date getLastDdlTime2() {
        return lastDdlTime2;
    }

    public void setLastDdlTime2(Date lastDdlTime2) {
        this.lastDdlTime2 = lastDdlTime2;
    }
}
